package com.alks.function.controller.chengKong;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.chengKong.LotNoRequest;
import com.alks.function.data.request.chengKong.StyleNoRequest;
import com.alks.function.data.request.chengKong.StyleNoToColorRequest;
import com.alks.function.data.request.chengKong.cost.LotNoCutPriceRequest;
import com.alks.function.data.request.chengKong.cost.UpdatePcCutPriceDetail0Request;
import com.alks.function.data.request.chengKong.cost.UpdatePcCutPriceDetailRequest;
import com.alks.function.data.request.chengKong.cost.generateCutLotNoPriceRequest;
import com.alks.function.service.chengKong.CostAssignmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@ApiRestController("/cost")
@Slf4j
@Api(tags = {"成控部-工厂成本作业-冲裁单价建档",
              "成控部-工厂成本作业-冲裁指令单价",
            "成控部-工厂成本作业-手工单价建档",
            "成控部-工厂成本作业-手工指令单价"})
public class CostAssignmentController {

    @Resource
    private CostAssignmentService costAssignmentService;

    @WebLogger
    @PostMapping("/SelectTypeList/{choose}")
    @ApiOperation(value = "选择型体 1冲裁单价,2手工单价",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo SelectTypeList(@RequestBody StyleNoRequest request, @PathVariable(value = "choose") Integer choose) {
        return costAssignmentService.SelectTypeList(request,choose);
    }

    @WebLogger
    @PostMapping("/TypeInformationList/{choose}")
    @ApiOperation(value = "型体资料 1冲裁单价,2手工单价",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo TypeInformationList(@RequestBody StyleNoRequest request,@PathVariable(value = "choose") Integer choose) {
        return costAssignmentService.TypeInformationList(request,choose);
    }

    @WebLogger
    @PostMapping("/UnitPriceOfPunchingType")
    @ApiOperation(value = "冲裁型体单价明细档查询",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo UnitPriceOfPunchingType(@RequestBody StyleNoToColorRequest request) {
        return costAssignmentService.UnitPriceOfPunchingType(request);
    }

    @WebLogger
    @PostMapping("/fetchList")
    @ApiOperation(value = "取数",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo fetchList(@RequestBody StyleNoToColorRequest request) {
        return costAssignmentService.fetchList(request);
    }

    @WebLogger
    @PostMapping("/delBySeqNo")
    @ApiOperation(value = "根据序号删除",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo delBySeqNo(@RequestBody StyleNoToColorRequest request,@RequestParam String seqNo) {
        return costAssignmentService.delBySeqNo(request,seqNo);
    }

    @WebLogger
    @PostMapping("/TakeDevelopmentDifferences")
    @ApiOperation(value = "取开发差异",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo TakeDevelopmentDifferences(@RequestBody StyleNoToColorRequest request) {
        return costAssignmentService.TakeDevelopmentDifferences(request);
    }

    @WebLogger
    @PostMapping("/deletePcCutPriceDetail/{choose}")
    @ApiOperation(value = "删除 1冲裁单价,2手工单价 ",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo deletePcCutPriceDetail(@RequestBody StyleNoToColorRequest request,@PathVariable("choose") Integer choose) {
        return costAssignmentService.deletePcCutPriceDetail(request,choose);
    }

    @WebLogger
    @PutMapping("/updatePcCutPriceDetail")
    @ApiOperation(value = "冲裁型体单价明细修改", tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo updatePcCutPriceDetail(@RequestBody UpdatePcCutPriceDetailRequest request) {
        return costAssignmentService.updatePcCutPriceDetail(request);
    }

    @WebLogger
    @PostMapping("/CheckOutPcCutPriceDetail/{choose}")
    @ApiOperation(value = "0检核/1取消检核",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo CheckOutPcCutPriceDetail(@RequestBody StyleNoToColorRequest request, @PathVariable("choose") Integer choose){
        return costAssignmentService.CheckOutPcCutPriceDetail(request,choose);
    }

    @WebLogger
    @PostMapping("/copyPriceToOtherStyle")
    @ApiOperation(value = "复制单价到其他配色 ",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo copyPriceToOtherStyle(@RequestBody Map<String,String> map) {
        return costAssignmentService.copyPriceToOtherStyle(map);
    }

    @WebLogger
    @PostMapping("/copyPriceToOtherStyle2")
    @ApiOperation(value = "从其他型体复制单价 ",tags = "成控部-工厂成本作业-冲裁单价建档")
    public ResponseInfo copyPriceToOtherStyle2(@RequestBody Map<String,String> map) {
        return costAssignmentService.copyPriceToOtherStyle2(map);
    }

    @WebLogger
    @PostMapping("/LotNoDetail/{choose}")
    @ApiOperation(value = "选择指令 1冲裁指令,2手工指令", tags = "成控部-工厂成本作业-冲裁指令单价")
    public ResponseInfo LotNoDetail(@RequestBody LotNoCutPriceRequest request, @PathVariable("choose") Integer choose) {
        return costAssignmentService.LotNoDetail(request,choose);
    }

    @WebLogger
    @PostMapping("/getLotNoDetail/{choose}")
    @ApiOperation(value = "指令查询 1冲裁指令,2手工指令", tags = "成控部-工厂成本作业-冲裁指令单价")
    public ResponseInfo getLotNoDetail(@RequestBody LotNoCutPriceRequest request,@PathVariable("choose") Integer choose) {
        return costAssignmentService.getLotNoDetail(request,choose);
    }

    @WebLogger
    @PostMapping("/LotNoUnitPriceOfPunchingType")
    @ApiOperation(value = "指令冲裁单价明细", tags = "成控部-工厂成本作业-冲裁指令单价")
    public ResponseInfo LotNoUnitPriceOfPunchingType(@RequestBody LotNoRequest request) {
        return costAssignmentService.LotNoUnitPriceOfPunchingType(request);
    }

    @WebLogger
    @PostMapping("/GenerateInstructionUnitPrice")
    @ApiOperation(value = "生成指令单价", tags = "成控部-工厂成本作业-冲裁指令单价")
    public ResponseInfo GenerateInstructionUnitPrice(@RequestBody generateCutLotNoPriceRequest request) {
        return costAssignmentService.GenerateInstructionUnitPrice(request);
    }

    @WebLogger
    @PostMapping("/RegenerateInstructionUnitPrice")
    @ApiOperation(value = "重新生成指令单价", tags = "成控部-工厂成本作业-冲裁指令单价")
    public ResponseInfo RegenerateInstructionUnitPrice(@RequestBody generateCutLotNoPriceRequest request) {
        return costAssignmentService.RegenerateInstructionUnitPrice(request);
    }

    @WebLogger
    @GetMapping("/ExportOfPunchingInstructions")
    @ApiOperation(value = "导出", tags = "成控部-工厂成本作业-冲裁指令单价")
    public void ExportOfPunchingInstructions(@RequestParam String lotNo,HttpServletResponse response) {
        costAssignmentService.ExportOfPunchingInstructions(lotNo,response);
    }

    @WebLogger
    @PostMapping("/ProcessStepsList")
    @ApiOperation(value = "工艺工序", tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo ProcessStepsList(@RequestBody StyleNoToColorRequest request) {
        return costAssignmentService.ProcessStepsList(request);
    }

    @WebLogger
    @PostMapping("/CheckOutPcCutPriceDetailO/{choose}")
    @ApiOperation(value = "0检核/1取消检核",tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo CheckOutPcCutPriceDetailO(@RequestBody StyleNoToColorRequest request, @PathVariable("choose") Integer choose){
        return costAssignmentService.CheckOutPcCutPriceDetailO(request,choose);
    }

    @WebLogger
    @PostMapping("/ExportOfProcessSteps")
    @ApiOperation(value = "导出",tags = "成控部-工厂成本作业-手工单价建档")
    public void ExportOfProcessSteps(@RequestBody StyleNoToColorRequest request,HttpServletResponse response){
        costAssignmentService.ExportOfProcessSteps(request,response);
    }

    @WebLogger
    @PostMapping("/TakeDevelopmentDifferences2")
    @ApiOperation(value = "取开发差异",tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo TakeDevelopmentDifferences2(@RequestBody StyleNoToColorRequest request) {
        return costAssignmentService.TakeDevelopmentDifferences2(request);
    }

    @WebLogger
    @PostMapping("/GenerateInstructionProcessUnitPrice/{choose}")
    @ApiOperation(value = "生成指令单价", tags = "成控部-工厂成本作业-手工指令单价")
    public ResponseInfo GenerateInstructionProcessUnitPrice(@RequestBody generateCutLotNoPriceRequest request,@PathVariable("choose") Integer choose) {
        return costAssignmentService.GenerateInstructionProcessUnitPrice(request,choose);
    }

    @WebLogger
    @GetMapping("/ExportManualInstructionUnitPrice")
    @ApiOperation(value = "导出",tags = "成控部-工厂成本作业-手工指令单价")
    public void ExportManualInstructionUnitPrice(@RequestParam String lotNo,HttpServletResponse response){
        costAssignmentService.ExportManualInstructionUnitPrice(lotNo,response);
    }

    @WebLogger
    @PostMapping("/InstructionProcessUnitPriceDetails")
    @ApiOperation(value = "指令工艺单价明细", tags = "成控部-工厂成本作业-手工指令单价")
    public ResponseInfo InstructionProcessUnitPriceDetails(@RequestBody LotNoRequest request) {
        return costAssignmentService.InstructionProcessUnitPriceDetails(request);
    }

    @WebLogger
    @PutMapping("/updatePcCutPriceDetail0")
    @ApiOperation(value = "工艺工序修改", tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo updatePcCutPriceDetail0(@RequestBody UpdatePcCutPriceDetail0Request request) {
        return costAssignmentService.updatePcCutPriceDetail0(request);
    }

    @WebLogger
    @PostMapping("/copyPriceToOtherStyle3")
    @ApiOperation(value = "复制单价到其他配色 ",tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo copyPriceToOtherStyle3(@RequestBody Map<String,String> map) {
        return costAssignmentService.copyPriceToOtherStyle3(map);
    }

    @WebLogger
    @PostMapping("/copyPriceToOtherStyle4")
    @ApiOperation(value = "从其他型体复制单价 ",tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo copyPriceToOtherStyle4(@RequestBody Map<String,String> map) {
        return costAssignmentService.copyPriceToOtherStyle4(map);
    }

    @WebLogger
    @PostMapping("/ExportOfPunchingUnitPrice")
    @ApiOperation(value = "导出",tags = "成控部-工厂成本作业-冲裁单价建档")
    public void ExportOfPunchingUnitPrice(@RequestBody StyleNoToColorRequest request,HttpServletResponse response){
        costAssignmentService.ExportOfPunchingUnitPrice(request,response);
    }

    @WebLogger
    @PostMapping("/ManualUnitPriceRetrieval")
    @ApiOperation(value = "取数",tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo ManualUnitPriceRetrieval(@RequestBody StyleNoToColorRequest request) {
        return costAssignmentService.ManualUnitPriceRetrieval(request);
    }

    @WebLogger
    @PostMapping("/delBySeqNo2")
    @ApiOperation(value = "根据序号删除",tags = "成控部-工厂成本作业-手工单价建档")
    public ResponseInfo delBySeqNo2(@RequestBody StyleNoToColorRequest request,@RequestParam String seqNo) {
        return costAssignmentService.delBySeqNo2(request,seqNo);
    }
}
